$.ajax({
    url: "./headInfo",
    method: "GET",
    dataType: "json"
}).done(function (result) {
    updateHeadInfo(result.headInfo);
}).fail(function (xhr, status) {
    console.log(status);
});

function updateHeadInfo(headInfo) {
    if(headInfo.avatar!="null")
        $(".xwcms").attr("src","/MySpace/avatar/"+headInfo.avatar);
    $(".logo-text").text(headInfo.nickname);
    if(headInfo.signature!="null")
        $(".signature").text(headInfo.signature);
}

